<template>
	<view :style="{height:pageHeight}">
		<view class="person">
			<view class="person_box">
				<view class="d_top_do">
					<view class="wenben" @click="gotoRouter">修改密码</view>
				</view>
				<view class="d_top_box">
					<view class="user_info">
						<view class="user_name">姓名：{{userInfo.realName}}</view>
						<view class="user_joine">
							顾客资格：{{userInfo.lastJoinLevelDesc}} 荣衔级别：{{userInfo.lastHonorTypeDesc}}</view>
					</view>
				</view>
			</view>
			<view class="link_box">
				<view v-for="(e,i) in orderType" :key="i" @click="goRouter(e)">
					<image :src="e.image"></image>
					{{e.name}}
				</view>
			</view>
			<view class="userVIP_Item">
				<view v-for="(ele,ind) in userList" :key="ind" @click="goRouter(ele)">
					<image :src="ele.img"></image>
					<view>{{ele.name}}</view>
					<!-- 					<text class='iconfont icon-xiangyou' style="margin-left:5rpx;"></text>
 -->
				</view>
			</view>
		</view>
		<view class="tishi">
			<directSelling></directSelling>
		</view>

		<pageFooter v-if="footerStatus"></pageFooter>
	</view>
</template>

<script>
	import pageFooter from '@/components/pageFooter/index.vue';
	import directSelling from '@/pages/index/components/directSelling'
	import store from '@/store';
	import {
		zhixiao_IFramURl
	} from '@/config/app_member.js';
	import {
		getMemberInfo
	} from '@/api/directSelling.js'
	import {
		toLogin
	} from '@/libs/login.js';
	export default {
		components: {
			pageFooter,
			directSelling
		},
		data() {
			return {
				// #ifdef H5 || MP
				pageHeight: '667px',
				// #endif
				// #ifdef APP-PLUS
				//pageHeight: app.globalData.windowHeight,
				pageHeight: '667px',
				// #endif
				footerStatus: true,
				userInfo: {},
				orderType: [{
						name: "全部订单",
						image: "/static/images/qbdd.png",
						//image:'/static/images/member_sjdp.png',
						path: zhixiao_IFramURl+"/personal/myOrder?activeTabs=0",
						isJump: true
					},
					{
						name: "待支付",
						image: "/static/images/dzf.png",
						path: zhixiao_IFramURl+"/personal/myOrder?activeTabs=1",
						isJump: true
					}, {
						name: "已支付",
						image: "/static/images/yzf.png",
						path: zhixiao_IFramURl+"/personal/myOrder?activeTabs=2",
						isJump: true
					}, {
						name: "已发货",
						image: "/static/images/yfh.png",
						path: zhixiao_IFramURl+"/personal/myOrder?activeTabs=3",
						isJump: true
					}
				],
				userList: [
					{
						name: "查看业绩",
						path: "/pages/directSellingPage/performanceView/index",
						isJump: false,
						img: "/static/images/member_yjck.png"
					},
					{
						name: "电子钱包",
						path: "/pages/electronicWallet/electronicWallet/index",
						isJump: false,
						img: "/static/images/member_dzqb.png"
					},{
						name: "个人信息",
						img: "/static/images/member_gerx.png",
						path:"/pages/zx_users/personalInformation/index",
						isJump:false
					},
					{
						name: "消费补贴资格",
						path: zhixiao_IFramURl+"/personal/seniority",
						isJump: true,
						img: "/static/images/member_xfbtzg.png"
					},
					{
						name: "服务留言",
						path: zhixiao_IFramURl+"/personal/serviceMsg",
						isJump: true,
						img: "/static/images/member_fwly.png"
					},
					{
						name: "设置主账号",
						path: zhixiao_IFramURl+"/personal/setMainAccount",
						isJump: true,
						img: "/static/images/member_szzzh.png"
					},
					{
						name: "升级店铺",
						img: "/static/images/member_sjdp.png",
						path:zhixiao_IFramURl+"/orderManagement/upgradeFirst",
						isJump:true
					},{
						name: "会员申请",
						path: zhixiao_IFramURl+"/orderManagement/regiestNewFirst",
						isJump: true,
						img: "/static/images/member_hysq.png"
					},
				],
			};
		},
		created() {},
		mounted() {
			uni.hideTabBar()
			this.getUserData();
		},
		methods: {
			getUserData() {
				let _this = this;
				getMemberInfo().then((res) => {
					let data = res.data;
					if (data) {
						_this.userInfo = data;
						uni.setStorageSync('userInfo',data);
						uni.setStorageSync('tab_id', null);
					}
				}).catch((err) => {
					console.log(err);
				})
			},
			gotoRouter(){
				let path=zhixiao_IFramURl+"/personal/updatepwd"
				uni.navigateTo({
					url: "/pages/user/memberCenterJumb?title='修改密码'&path=" + path
				});
			},
			goRouter(ele) {
				if (ele.isJump == false) {
					uni.navigateTo({
						url: ele.path
					});
				} else {
					uni.navigateTo({
						url: "/pages/user/memberCenterJumb?path=" + ele.path+"&title="+ele.name
					});
				}
			}
		}
	};
</script>

<style lang="scss">
	page {
		background: #fff;
	}

	.person_box {
		width: 100%;
		height: 236rpx;
		overflow: hidden;
		background-image: url(/static/images/usercenter.png);
		background-repeat: no-repeat;
		background-size: cover;

		.d_top_do {
			width: 100%;
			height: 20rpx;
			text-align: right;
			margin-top: 90rpx;
			padding: 0 50rpx;
			box-sizing: border-box;
			position: relative;
			.wenben {
				font-size: 28rpx;
				font-weight: 500;
				color: #fff;
				width:130rpx;
				position: absolute;
				right:30rpx;
			}
		}

		.d_top_box {
			width: 100%;
			padding: 0 30rpx;
			display: -webkit-box;
			display: -ms-flexbox;
			display: flex;
			-ms-flex-wrap: wrap;
			flex-wrap: wrap;
			-webkit-box-align: center;
			-ms-flex-align: center;
			align-items: center;
			margin-top: 20rpx;

			.user_info {
				display: -webkit-box;
				display: -ms-flexbox;
				display: flex;
				-webkit-box-orient: vertical;
				-webkit-box-direction: normal;
				-ms-flex-direction: column;
				flex-direction: column;
				margin-left: 50rpx;

				.user_name {
					font-size: 50;
					font-family: PingFang SC;
					font-weight: 500;
					color: #FFFFFF;
				}

				.user_joine {
					margin-top: 8rpx;
					font-size: 28rpx;
					font-family: PingFang SC;
					font-weight: 400;
					color: #FFFFFF;
				}
			}
		}
	}

	.link_box {
		height: 160rpx;
		border-bottom: 1px solid #ccc;
		display: flex;
		justify-content: center;
		align-items: center;
		width:calc(100% - 30rpx);
		margin-left:15rpx;
		>view {
			flex: 1;
			//line-height:140rpx;
			text-align: center;
			font-size: 24rpx;
			border-right: 1px solid #ccc;

			image {
				width: 50rpx;
				height: 50rpx;
				display: block;
				margin: 0 auto;
				margin-bottom:10rpx;
			}
		}

		>view:nth-child(4) {
			border-right: none;
		}
	}

	.userVIP_Item {
		width: calc(100% - 30rpx);
		height: auto;
		padding: 30rpx 10rpx;
		box-sizing: border-box;
		border-bottom: 1px solid #ccc;
		display: flex;
		flex-wrap: wrap;
		margin-left:15rpx;
		>view {
			width: 25%;
			position: relative;
			display: flex;
			align-items: center;
			justify-content: space-between;
			flex-direction: column;
			margin-bottom:40rpx;
			font-size:26rpx;
			image {
				width: 50rpx;
				height: 50rpx;
				margin-bottom:20rpx;
			}
		}
	}
</style>
